import axios from '@/libs/api.request'

// 注册
export const saveUser = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/saveUser',
    method: 'post',
    data: data
  })
}

// 注册
export const loginUser = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/loginUser',
    method: 'post',
    data: data
  })
}

// 查询城市信息
export const selectCityList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/selectCityList',
    method: 'post',
    data: data
  })
}

// 根据城市查询服务
export const selectGiveServiceCityList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/selectGiveServiceCityList',
    method: 'post',
    data: data
  })
}

// 根据城市查询医院
export const selectHospitalList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/selectHospitalList',
    method: 'post',
    data: data
  })
}

// 根据城市查询陪诊师
export const selectAccompanyingPhysicianList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/selectAccompanyingPhysicianList',
    method: 'post',
    data: data
  })
}

// 根据服务类别查询服务列表
export const findGiveServiceTypeList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/giveService/findGiveServiceTypeList',
    method: 'post',
    data: data
  })
}

// 查询就诊人
export const selectMedicalVisitorList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/selectMedicalVisitorList',
    method: 'post',
    data: data
  })
}

// 添加就诊人
export const insertVisitor = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/insertVisitor',
    method: 'post',
    data: data
  })
}

// 根据id查询就诊人
export const getVisitor = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/getVisitor',
    method: 'post',
    data: data
  })
}

// 根据id删除就诊人
export const deleteVisitor = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/deleteVisitor',
    method: 'post',
    data: data
  })
}

// 查询首页banner
export const findRotationChartList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/findRotationChartList',
    method: 'post',
    data: data
  })
}

// 查询医院详情
export const getHospital = (data) => {
  return axios.request({
    url: '/api/uc/mobile/hospitalDepartmentService/getHospital',
    method: 'post',
    data: data
  })
}

// 查询医院服务
export const findGiveServiceList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/giveService/findGiveServiceList',
    method: 'post',
    data: data
  })
}

// 查询陪诊师信息
export const getAccompanyingPhysician = (data) => {
  return axios.request({
    url: '/api/uc/mobile/accompanyingPhysicianService/getAccompanyingPhysician',
    method: 'post',
    data: data
  })
}

// 查询地址列表
export const selectAddressList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/selectAddressList',
    method: 'post',
    data: data
  })
}

// 添加地址
export const insertAddress = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/insertAddress',
    method: 'post',
    data: data
  })
}

// 根据id查询地址详情
export const getMemberAddress = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/getMemberAddress',
    method: 'post',
    data: data
  })
}

// 根据id删除地址
export const deleteMemberAddress = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/deleteMemberAddress',
    method: 'post',
    data: data
  })
}

// 获取用户协议/隐私政策/关于我们
export const getOfficeInstall = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/getOfficeInstall',
    method: 'post',
    data: data
  })
}

// 上传获取签名
export const getSignToHadoop = (data) => {
  return axios.request({
    url: '/api/ac/medical/auditHadoopUploadFilesService/getSign',
    method: 'post',
    data: data
  })
}

// 上传图片
export const uploadFilesToHadoop = (url, data) => {
  return axios.request({
    url: url,
    method: 'post',
    data: data
  })
}

// 修改用户信息
export const updateMember = (data) => {
  return axios.request({
    url: '/api/uc/mobile/memberService/updateMember',
    method: 'post',
    data: data
  })
}
// 7.26日 马超群
// 会员端订单列表
export const selectMemberOrderList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/orderGoodsService/selectMemberOrderList',
    method: 'post',
    data: data
  })
}
// 根据医院查询二级科室
export const findDepartmentList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/hospitalDepartmentService/findDepartmentList',
    method: 'post',
    data: data
  })
}
// 获取当前年月日时分方法
export function getTime (date1) {
  var date = new Date(date1)
  var year = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var hour = date.getHours()
  var minute = date.getMinutes()
  var time = addZero(year) + '-' + addZero(month) + '-' + addZero(day) + ' ' + addZero(hour) + ':' + addZero(minute)
  return time
}
// 获取当前年月日方法
export function getZdyDate (date1) {
  var date = new Date(date1)
  var year = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var time = addZero(year) + '-' + addZero(month) + '-' + addZero(day)
  return time
}
export function addZero (s) {
  return s < 10 ? ('0' + s) : s
}
// 7.26日 马超群
// 7.27
// 发起订单
export const saveOrderGoods = (data) => {
  return axios.request({
    url: '/api/uc/mobile/orderGoodsService/saveOrderGoods',
    method: 'post',
    data: data
  })
}
// 订单详情
export const getOrderDetails = (data) => {
  return axios.request({
    url: '/api/uc/mobile/orderGoodsService/getOrderDetails',
    method: 'post',
    data: data
  })
}
// 取消订单
export const saveOrderGoodsNext = (data) => {
  return axios.request({
    url: '/api/uc/mobile/orderGoodsService/saveOrderGoodsNext',
    method: 'post',
    data: data
  })
}
export function GetDateStr (Count) {
  var dd = new Date()
  dd.setDate(dd.getDate() + Count) // 获取Count天后的日期
  var y = dd.getFullYear() // 获取当年年份
  var m = dd.getMonth() + 1 // 获取当前月份
  m = m < 10 ? '0' + m : m
  var d = dd.getDate() // 获取当前月份的日期
  d = d < 10 ? '0' + d : d
  var w = dd.getDay() // 获取星期几
  var week
  switch (w) {
    case 0:
      week = '周日'
      break
    case 1:
      week = '周一'
      break
    case 2:
      week = '周二'
      break
    case 3:
      week = '周三'
      break
    case 4:
      week = '周四'
      break
    case 5:
      week = '周五'
      break
    case 6:
      week = '周六'
      break
  }
  if (Count === 0) {
    week = '今日'
  }
  return [y + '-' + m + '-' + d, m + '/' + d, week]
}
// 搜索列表
export const findScreenList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/homePageService/findScreenList',
    method: 'post',
    data: data
  })
}
export function date0str (date, containtime) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var hour = date.getHours()
  var min = date.getMinutes()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  time1 += ' ' + (hour < 10 ? '0' + hour : hour)
  time1 += ':' + (min < 10 ? '0' + min : min)
  return time1
}

// 消息列表
export const selectNotificationMessageNewList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/selectNotificationMessageNewList',
    method: 'post',
    data: data
  })
}
// 获取系统消息列表（新2023-08-30）
export const getNotificationMessageNewSys = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/getNotificationMessageNewSys',
    method: 'post',
    data: data
  })
}
// 获取未读消息
export const selectIsReadeList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/selectIsReadeList',
    method: 'post',
    data: data
  })
}

// 获取消息列表
export const selectNotificationMessageList = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/selectNotificationMessageList',
    method: 'post',
    data: data
  })
}

// 变更消息状态
export const updateIsReade = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/updateIsReade',
    method: 'post',
    data: data
  })
}

// 发消息
export const saveNotificationMessage = (data) => {
  return axios.request({
    url: '/api/uc/mobile/notificationMessageService/saveNotificationMessage',
    method: 'post',
    data: data
  })
}
// 添加评价及打分
export const insertOrderEvaluation = (data) => {
  return axios.request({
    url: '/api/uc/mobile/orderGoodsService/insertOrderEvaluation',
    method: 'post',
    data: data
  })
}
